package com.athbsd;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Random;
import java.util.Set;

/**
 * Date:2025/2/24
 * Author：zhouzhou
 * Description:
 */
public class ex1 {
    public static void main(String[] args) {
        Set set = new HashSet();
        int count=0;
        while (set.size() < 10) {
            int random = (int) (Math.random() * 11);
            count++;
            set.add(random);
        }
        Iterator iterator = set.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }
        System.out.println(count+"次数");
    }
}
